// 文件上传记录
const mongoose = require('./db')
const ObjectId = mongoose.Schema.Types.ObjectId

const FileSchema = new mongoose.Schema({
  filename: String,
  path: String,
  user: { type: ObjectId, ref: 'Admin' },
  username: String,
  size: String,
  originalname: String,
}, {
  collection: 'File',
  timestamps: {
    createdAt: true,
    updatedAt: false,
  }
})

const File = mongoose.model('File', FileSchema)

module.exports = File
